<%--
  Created by IntelliJ IDEA.
  User: BHT
  Date: 2022/11/28 0028
  Time: 8:35:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta charset="utf-8">
  <title>table模块快速使用</title>
  <link rel="stylesheet" href="http://layui.org.cn/res/layui/dist/css/layui.css" media="all">
</head>
<body>

<table id="demo" lay-filter="test"></table>

<script src="http://layui.org.cn/res/layui/dist/layui.js"></script>
<script>
  layui.use('table', function(){
    var table = layui.table;
    //第一个实例
    table.render({
      elem: '#demo'
      ,height: 312
      ,url: '${pageContext.request.contextPath}/web' //数据接口
      ,page: true //开启分页
      ,cols: [[ //表头
        {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
        ,{field: 'username', title: '用户名', width:80}
        ,{field: 'sex', title: '性别', width:80, sort: true}
        ,{field: 'money', title: '字数', width: 135, sort: true}
      ]]
    });
  });
</script>
</body>
</html>
